from .admin.admin import admin_controller
from .admin.tag import tag_controller
from .admin.category import category_controller
from .admin.article import article_controller
from .admin.upload import upload_controller
from .admin.link import link_controller

from .home.index import home_controller
from .home.category import home_category
from .home.artcle import home_article
from .home.search import home_search

default_blueprint = (
    # 后端蓝图
    (admin_controller, "/admin"),
    (tag_controller, "/admin"),
    (category_controller, "/admin"),
    (article_controller, "/admin"),
    (upload_controller, "/admin"),
    (link_controller, "/admin"),

    # 前端蓝图
    (home_controller, "/"),
    (home_category, "/category"),
    (home_article, "/article"),
    (home_search, "/search")
)

def register_blueprint(app):
    for blueprint, url_prefix in default_blueprint:
        app.register_blueprint(blueprint, url_prefix = url_prefix)